import formBuilder from "@/comps/form/formBuilder";
import api from "./api";

export default {
    main:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addText("account").setSpan(3).setLabel("账号")
            .setRules([fb.R.notNull("账号不能为空")])

        fb.addText("name").setSpan(3).setLabel("姓名")

        fb.addText("code").setSpan(3).setLabel("工号").setMaxLength(16)
        fb.addText("idcard").setSpan(3).setLabel("身份证号").setMaxLength(16)

        fb.addText("phone").setLabel("手机号").setSpan(3).setMaxLength(11)
            .setRules([
                fb.R.notNull("手机号不能为空"),
                fb.R.lenMustGt(11,"手机号长度为11"),
                fb.R.lenMustLt(11,"手机号长度为11"),
            ])
        return fb
    },
    other:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100).setLabelPosition("right")

        return fb
    }
}